package cn.dliyy.base.dao;

import org.springframework.stereotype.Component;

@Component
public class HQL {

	public String getListHQL(Class c){
		StringBuffer sff = new StringBuffer();
		sff.append("select a from ").append(c.getSimpleName()).append(" a ");
		return sff.toString();
	}
	public String getListHQL(Class c,int start,int length){
		StringBuffer sff = new StringBuffer();
		sff.append("select a from ").append(c.getSimpleName()).append(" a ");
		return sff.toString();
	}
	public String getOne(Class c,String primaryKey){
		StringBuffer sff = new StringBuffer();
		sff.append("from ").append(c.getSimpleName()).append(" a ")
		.append("where a.id='" + primaryKey + "'");
		return sff.toString();
	}
}
